{include title="欢迎登录" keywords="" description=""  file='../application/admin/view/layout/header.html' /}
<link href="/static/admin/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<script></script>
<body>
<input type="hidden" id="TenantId" name="TenantId" value=""/>
<div class="header"></div>
<div class="loginWraper">
    <div id="loginform" style="top: 43%;" class="loginBox">
        <form class="form form-horizontal" action="{:url('admin/login/index')}" method="post">
            {:token()}
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-8">
                    <input name="username" type="text" placeholder="用户名" class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-8">
                    <input name="password" type="password" placeholder="密码" class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <input name="captcha" class="input-text size-L" type="text" placeholder="验证码" style="width:150px;">
                    <img style="width: 120px;height: 40px;" src="{:url('admin/login/getCaptcha')}"  onclick="this.src='{:url(\'admin/login/getCaptcha\')}?d='+Math.random();">
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <label for="online">
                        <input type="checkbox" name="online" id="online" value="1">
                        使我保持登录状态</label>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <input style="width: 360px;" name="" type="submit" class="btn btn-success radius size-L"
                           value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer">Copyright 瑞美森国际教育</div>
</body>
<script>
    //前端验证
    var check = $(".form").Validform({
        tiptype: function (msg, o) {
            if (o.type == 3) {layer.msg(msg, {icon: 2,offset: '50%'});}
        },
        ajaxPost: true,
        callback: function (data) {
            if(data.status=='y'){
                layer.msg(data.info, {icon: 1});
                setTimeout(function(){
                    location.href = "{:url('admin/index/index')}";
                },1000);
            }else{
                $("[name=__token__]").val(data.token);
            }
        }
    });
    check.addRule([
        {ele: "[name='username']", datatype: /^\w{4,18}$/, nullmsg: '请填写用户名', errormsg: "用户名在4至18位之间的数字、字母、下划线"},
        {ele: "[name='password']", datatype: /[a-z\d#@!~%^&*]{6,18}/i, nullmsg: '请填写密码', errormsg: "密码在6到18位之间的数字、字母、英文符号"},
        {ele: "[name='captcha']", datatype: /^[a-zA-Z0-9]{4}$/, nullmsg: '请输入验证码', errormsg: "验证码为4位数字字母"}
    ]);
</script>
</html>